package com.zzc.study.config;


import com.zzc.study.service.ExpressService;
import com.zzc.study.service.WeatherService;
import jakarta.annotation.Resource;
import org.springframework.ai.tool.ToolCallbackProvider;
import org.springframework.ai.tool.method.MethodToolCallbackProvider;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;


@Configuration
public class ToolsConfig
{
    @Resource
    private ExpressService expressService;

    // 将 MCP 工具方法暴露出去
    @Bean
    public ToolCallbackProvider expressTools()
    {
        return MethodToolCallbackProvider.builder()
                .toolObjects(expressService) // 工具方法暴露出去
                .build();
    }

    @Bean
    public ToolCallbackProvider weatherTools(WeatherService weatherService) {
        return MethodToolCallbackProvider.builder()
                .toolObjects(weatherService)
                .build();
    }
}
